'use strict'

//连接数据库
var Sequelize = require('sequelize');
var sequelize = new Sequelize('node_crawler_2', 'root', '123456', {
    host: 'localhost',
    dialect: 'mysql'
});

sequelize
    .authenticate()
    .then(() => {
        console.log(`连接数据库成功`)
    })
    .catch(err => {
        console.log(`连接失败${err}`)
    });

module.exports = sequelize